void initControls(){
  
  lock = false;
  
  //---------------------
  
  numFilters = columnCount;
  numFilteredColumns = columnCount;
  
  filterX1 = mainPlotX2 + 50;
  filterX2 = filterX1 + 100;
  filterY1 = mainPlotY1;
  filterY2 = filterY1 + 30 * numFilters;
  
  onFilter = false;
  
  filtersChosen = new int[numFilters];
  for(int i=0; i< numFilters; i++){
   filtersChosen[i] = 1;
  }
  
  checkBoxDim = 12;
  //---------------------
  
  timeScrollBarX1 = mainPlotX1;
  timeScrollBarX2 = mainPlotX1 + 250;
  
  timeScrollBarY1 = mainPlotY1 - 100;
  timeScrollBarY2 = timeScrollBarY1 + 15;
  
  timeSliderDimX = 6;
  timeSliderDimY = timeScrollBarY2 - timeScrollBarY1;
  
  ltimeSliderPos = timeScrollBarX1;
  rtimeSliderPos = timeScrollBarX2;
  
  timeSliderPosY = timeScrollBarY1;
  
  isLTimeSlider = false;
  isRTimeSlider = false;
  
  onSlider = false;
  devMouse_LeftSlider = 0;
  //greyTimeBarOut = false;
  //---------------------
  
  
  
  //---------------------
  
  hueScrollBarX1 = mainPlotX1;
  hueScrollBarX2 = timeScrollBarX2;
  
  hueScrollBarY1 = timeScrollBarY1 - 30;
  hueScrollBarY2 = hueScrollBarY1 + 15;
  
  hueSliderDimX = 6;
  hueSliderDimY = hueScrollBarY2 - hueScrollBarY1;
  
  lhueSliderPos = hueScrollBarX1;
  rhueSliderPos = lhueSliderPos + 50;
  
  hueSliderPosY = hueScrollBarY1;
  
  isLHueSlider = false;
  isRHueSlider = false;
  
  onHueSlider = false;
  devMouse_LeftHueSlider = 0;
  
  hueFlipPosX = hueScrollBarX2 + 15;
  hueFlipPosY = hueScrollBarY1 + hueSliderDimY / 2;
  hueFlipDim = hueSliderDimY - 4;
  
  isHueFlip = 1;
  
  //---------------------
  
  
  lumaScrollBarX1 = chromaScrollBarX2 + 30;
  lumaScrollBarX2 = lumaScrollBarX1 + 250;
  
  lumaScrollBarY1 = timeScrollBarY1 - 30;
  lumaScrollBarY2 = lumaScrollBarY1 + 15;
  
  lumaSliderDimX = 6;
  lumaSliderDimY = lumaScrollBarY2 - lumaScrollBarY1;
  
  llumaSliderPos = lumaScrollBarX1;
  rlumaSliderPos = lumaScrollBarX2;
  
  lumaSliderPosY = lumaScrollBarY1;
  
  isLLumaSlider = false;
  isRLumaSlider = false;
  
  onLumaSlider = false;
  devMouse_LeftLumaSlider = 0;
  
  lumaFlipPosX = lumaScrollBarX2 + 15;
  lumaFlipPosY = lumaScrollBarY1 + lumaSliderDimY / 2;
  lumaFlipDim = lumaSliderDimY - 4;
  
  isLumaFlip = 1;
  
    //---------------------
  
  
  chromaScrollBarX1 = hueScrollBarX2 + 30;
  chromaScrollBarX2 = chromaScrollBarX1 + 250;
  
  chromaScrollBarY1 = timeScrollBarY1 - 30;
  chromaScrollBarY2 = chromaScrollBarY1 + 15;
  
  chromaSliderDimX = 6;
  chromaSliderDimY = chromaScrollBarY2 - chromaScrollBarY1;
  
  lchromaSliderPos = chromaScrollBarX1 + 20;
  rchromaSliderPos = lchromaSliderPos + 70;
  
  chromaSliderPosY = chromaScrollBarY1;
  
  isLChromaSlider = false;
  isRChromaSlider = false;
  
  onChromaSlider = false;
  devMouse_LeftChromaSlider = 0;
  
  chromaFlipPosX = chromaScrollBarX2 + 15;
  chromaFlipPosY = chromaScrollBarY1 + chromaSliderDimY / 2;
  chromaFlipDim = chromaSliderDimY - 4;
  
  isChromaFlip = 0;
  
  //---------------------
  
  numDivScrollBarX1 = timeScrollBarX2 + 30;
  numDivScrollBarX2 = numDivScrollBarX1 + 250; 
  numDivScrollBarY1 = timeScrollBarY1;
  numDivScrollBarY2 = timeScrollBarY2;
  
  numSamples = rowCount / numDivisions;
  numDivSliderPos = (int)map(numSamples, 1, rowCount * 0.1, numDivScrollBarX1, numDivScrollBarX2);
  mapVal = (float)rowCount / (float)( timeScrollBarX2 - timeScrollBarX1);
  
  numDivSliderPosY = timeSliderPosY;

  onnumDivSlider = false;
  
  //---------------------
  
  numFiltersScrollBarX1 = numDivScrollBarX2 + 30;
  numFiltersScrollBarX2 = numFiltersScrollBarX1 + 250; 
  numFiltersScrollBarY1 = timeScrollBarY1;
  numFiltersScrollBarY2 = timeScrollBarY2;
  
  //numFiltersSliderPos = numFiltersScrollBarX2;
  //mapVal = (float)rowCount / (float)( timeScrollBarX2 - timeScrollBarX1);
  
  numFiltersSliderPosY = timeSliderPosY;
  numFilterColumns = columnCount;

  //onNumFiltersSlider = false;
  
  numFiltersSliderDimX = 6;
  numFiltersSliderDimY = numFiltersScrollBarY2 - numFiltersScrollBarY1;
  
  lnumFiltersSliderPos = numFiltersScrollBarX1 + 70;
  rnumFiltersSliderPos = numFiltersScrollBarX2 - 40;
  
  numFiltersSliderPosY = numFiltersScrollBarY1;
  
  isLNumFiltersSlider = false;
  isRNumFiltersSlider = false;
  
  onNumFiltersSlider = false;
  devMouse_LeftNumFiltersSlider = 0;
  
  // --------------------------
  coloringX1 = lumaScrollBarX2 + 70;
  coloringX2 = coloringX1 + 50;
  coloringY1 = lumaScrollBarY1 + 7;
  coloringY2 = numFiltersScrollBarY2 + 22;
  
  nColoring = 2;
  coloringLabel = new String[nColoring];
  coloringLabel[0] = "Rank Gradient";
  coloringLabel[1] = "Graph Gradient";
  
  selectedColoring = 0;
  
  //---------------------
  optionX1 = coloringX2 + coloringLabel[0].length() * 5 + 30;
  optionX2 = optionX1 + 50;
  optionY1 = lumaScrollBarY1 + 7;
  optionY2 = numFiltersScrollBarY2 + 22;
  
  nOption = 2;
  optionLabel = new String[nOption];
  optionLabel[0] = "Streamgraph";
  optionLabel[1] = "Trend lines";
  
  selectedOption = 0; // default view: streamgraph
}

void drawControls(){
  
  rectMode(CORNERS);
  fill(0xFF000000);
  noStroke();
  rect(0, 0, width, mainPlotY1 - 20);
  if(controller.numLayers > 1) rect(0, mainPlotY2 - 10, width, height);
  else rect(0, mainPlotY2 - 20, width, height);
  rect(mainPlotX2, mainPlotY1, width, height);
  rect(mainPlotX1, mainPlotY1, 0, height);
  
  textSize(20 );
  fill(0xBBF0F0F0);
  
  textAlign(CENTER, TOP);
  String string = "Streamgraph";
  if(graphMode == 1){
   string = "Silhouette";
  }else  if(graphMode == 2){
    string = "Upstream";
  }else if(graphMode == 3){
     string = "Baseline";
  }
  
  text(string,  optionX2 + optionLabel[0].length() * 15, hueScrollBarY2); 
  
  strokeWeight(1);
  rectMode(CORNERS);
  noStroke();
  fill(0x99F0F0F0);
  drawTimeScrollBar();
  fill(0x99F0F0F0);
  drawHueScrollBar();
  fill(0x99F0F0F0);
  drawLumaScrollBar();
  
  fill(0x99F0F0F0);
  drawChromaScrollBar();
  
  
  noStroke();
  fill(0x99F0F0F0);
  drawNumDivScrollBar();
  fill(0x99F0F0F0);
  drawNumFiltersScrollBar();
  stroke(0XFFFFFFFF);
  drawHueFlip();
  stroke(0XFFFFFFFF);
  drawLumaFlip();
  stroke(0XFFFFFFFF);
  drawChromaFlip();
  
  rectMode(CORNER);
  fill(0x88F0F0F0);
  stroke(0xFFFFFFFF);
  strokeWeight(1);
  //noStroke();
  drawTimeSliders();
  drawHueSliders();
  drawLumaSliders();
  drawChromaSliders();
  drawNumFiltersSliders();
  
  
}

boolean drawTrend() {
  if(selectedOption == 1) return true;
  return false;
}

void updateColoring() {
  if(selectedColoring == 0) selectedColoring = 1;
  else selectedColoring = 0;
}

boolean withinColoringBounds() {
  
  if(mouseX <= coloringX2 && mouseX >= coloringX1 && mouseY <= coloringY2 && mouseY >= coloringY1) return true;
  
  return false;
}

void updateOption() {
  if(selectedOption == 0) selectedOption = 1;
  else selectedOption = 0;
}

boolean withinOptionBounds() {
  
  if(mouseX <= optionX2 && mouseX >= optionX1 && mouseY <= optionY2 && mouseY >= optionY1) return true;
  
  return false;
  
}


boolean withinFilterBounds(){
 if( mouseX <= filterX2 && mouseX >= filterX1 &&
      mouseY <= filterY2 && mouseY >= filterY1)
      return true;
  return false;
}

boolean withinMainPlotBounds(){
  if( mouseX <= mainPlotX2 && mouseX >= mainPlotX1 &&
      mouseY <= mainPlotY2 && mouseY >= mainPlotY1)
      return true;
  return false;
    
}

boolean withinCustomBounds(float x1, float x2, float y1, float y2){
  if( mouseX <= x2 && mouseX >= x1 &&
      mouseY <= y2 + 4 && mouseY >= y1 + 4)
      return true;
  return false;
}

boolean withinTimeScrollBarBounds(){
  if( mouseX < timeScrollBarX2 + 5 && mouseX > timeScrollBarX1 - 5 &&
      mouseY < timeScrollBarY2 + 5 && mouseY > timeScrollBarY1 - 5)
      return true;
  return false;
    
}

boolean withinHueScrollBarBounds(){
  if( mouseX < hueScrollBarX2 + 5 && mouseX > hueScrollBarX1 - 5 &&
      mouseY < hueScrollBarY2 + 5 && mouseY > hueScrollBarY1 - 5)
      return true;
  return false;
    
}


boolean withinLumaScrollBarBounds(){
  if( mouseX < lumaScrollBarX2 + 5 && mouseX > lumaScrollBarX1 - 5 &&
      mouseY < lumaScrollBarY2 + 5 && mouseY > lumaScrollBarY1 - 5)
      return true;
  return false;
    
}

boolean withinChromaScrollBarBounds(){
  if( mouseX < chromaScrollBarX2 + 5 && mouseX > chromaScrollBarX1 - 5 &&
      mouseY < chromaScrollBarY2 + 5 && mouseY > chromaScrollBarY1 - 5)
      return true;
  return false;
    
}



boolean withinNumDivScrollBarBounds(){
  if( mouseX < numDivScrollBarX2 + 5 && mouseX > numDivScrollBarX1 - 5 &&
      mouseY < numDivScrollBarY2 + 5 && mouseY > numDivScrollBarY1 - 5)
      return true;
  return false;
    
}

boolean withinNumFiltersScrollBarBounds(){
  if( mouseX < numFiltersScrollBarX2 + 5 && mouseX > numFiltersScrollBarX1 - 5 &&
      mouseY < numFiltersScrollBarY2 + 5 && mouseY > numFiltersScrollBarY1 - 5)
      return true;
  return false;
    
}

boolean withinTrendPlotBounds() {
    if( mouseX <= trendPlotX2 && mouseX >= trendPlotX1 &&
        mouseY <= trendPlotY2 && mouseY >= trendPlotY1)
        return true;    
      return false;
}

//-------------------------


boolean overLTimeSlider(){
  if( mouseX <= ltimeSliderPos + timeSliderDimX / 2 && mouseX >= ltimeSliderPos - timeSliderDimX / 2 &&
      mouseY >= timeSliderPosY && mouseY <= timeSliderPosY + timeSliderDimY)
      return true;
   return false;
}

boolean overRTimeSlider(){
  if( mouseX <= rtimeSliderPos + timeSliderDimX / 2 && mouseX >= rtimeSliderPos - timeSliderDimX / 2 &&
      mouseY >= timeSliderPosY && mouseY <= timeSliderPosY + timeSliderDimY)
      return true;
   return false;
}

boolean betweenLRTimeSliders(){
  if( mouseX < rtimeSliderPos - timeSliderDimX / 2 && mouseX > ltimeSliderPos + timeSliderDimX / 2 &&
      mouseY >= timeSliderPosY && mouseY <= timeSliderPosY + timeSliderDimY)
      return true;
   return false;
}

//-------------------------

boolean overLHueSlider(){
  if( mouseX <= lhueSliderPos + hueSliderDimX / 2 && mouseX >= lhueSliderPos - hueSliderDimX / 2 &&
      mouseY >= hueSliderPosY && mouseY <= hueSliderPosY + hueSliderDimY)
      return true;
   return false;
}

boolean overRHueSlider(){
  if( mouseX <= rhueSliderPos + hueSliderDimX / 2 && mouseX >= rhueSliderPos - hueSliderDimX / 2 &&
      mouseY >= hueSliderPosY && mouseY <= hueSliderPosY + hueSliderDimY)
      return true;
   return false;
}

boolean betweenLRHueSliders(){
  if( mouseX < rhueSliderPos - timeSliderDimX / 2 && mouseX > lhueSliderPos + hueSliderDimX / 2 &&
      mouseY >= hueSliderPosY && mouseY <= hueSliderPosY + hueSliderDimY)
      return true;
   return false;
}

boolean overHueFlip(){

  if( mouseX <= hueFlipPosX + hueFlipDim/2 && mouseX >= hueFlipPosX - hueFlipDim/2 &&
      mouseY <= hueFlipPosY + hueFlipDim/2 && mouseY >= hueFlipPosY - hueFlipDim/2 )
      return true;
   return false;
}

//-------------------------


boolean overLLumaSlider(){
  if( mouseX <= llumaSliderPos + lumaSliderDimX / 2 && mouseX >= llumaSliderPos - lumaSliderDimX / 2 &&
      mouseY >= lumaSliderPosY && mouseY <= lumaSliderPosY + lumaSliderDimY)
      return true;
   return false;
}

boolean overRLumaSlider(){
  if( mouseX <= rlumaSliderPos + lumaSliderDimX / 2 && mouseX >= rlumaSliderPos - lumaSliderDimX / 2 &&
      mouseY >= lumaSliderPosY && mouseY <= lumaSliderPosY + lumaSliderDimY)
      return true;
   return false;
}

boolean betweenLRLumaSliders(){
  if( mouseX < rlumaSliderPos - timeSliderDimX / 2 && mouseX > llumaSliderPos + lumaSliderDimX / 2 &&
      mouseY >= lumaSliderPosY && mouseY <= lumaSliderPosY + lumaSliderDimY)
      return true;
   return false;
}

boolean overLumaFlip(){

  if( mouseX <= lumaFlipPosX + lumaFlipDim/2 && mouseX >= lumaFlipPosX - lumaFlipDim/2 &&
      mouseY <= lumaFlipPosY + lumaFlipDim/2 && mouseY >= lumaFlipPosY - lumaFlipDim/2 )
      return true;
   return false;
}


//-------------------------


boolean overLChromaSlider(){
  if( mouseX <= lchromaSliderPos + chromaSliderDimX / 2 && mouseX >= lchromaSliderPos - chromaSliderDimX / 2 &&
      mouseY >= chromaSliderPosY && mouseY <= chromaSliderPosY + chromaSliderDimY)
      return true;
   return false;
}

boolean overRChromaSlider(){
  if( mouseX <= rchromaSliderPos + chromaSliderDimX / 2 && mouseX >= rchromaSliderPos - chromaSliderDimX / 2 &&
      mouseY >= chromaSliderPosY && mouseY <= chromaSliderPosY + chromaSliderDimY)
      return true;
   return false;
}

boolean betweenLRChromaSliders(){
  if( mouseX < rchromaSliderPos - timeSliderDimX / 2 && mouseX > lchromaSliderPos + chromaSliderDimX / 2 &&
      mouseY >= chromaSliderPosY && mouseY <= chromaSliderPosY + chromaSliderDimY)
      return true;
   return false;
}

boolean overChromaFlip(){

  if( mouseX <= chromaFlipPosX + chromaFlipDim/2 && mouseX >= chromaFlipPosX - chromaFlipDim/2 &&
      mouseY <= chromaFlipPosY + chromaFlipDim/2 && mouseY >= chromaFlipPosY - chromaFlipDim/2 )
      return true;
   return false;
}

//-------------------------


boolean overnumDivSlider(){
  if( mouseX <= numDivSliderPos + timeSliderDimX / 2 && mouseX >= numDivSliderPos - timeSliderDimX / 2 &&
      mouseY >= numDivSliderPosY && mouseY <= numDivSliderPosY + timeSliderDimY)
      return true;
   return false;
}

//-------------------------

boolean overLNumFiltersSlider(){
  if( mouseX <= lnumFiltersSliderPos + numFiltersSliderDimX / 2 && mouseX >= lnumFiltersSliderPos - numFiltersSliderDimX / 2 &&
      mouseY >= numFiltersSliderPosY && mouseY <= numFiltersSliderPosY + numFiltersSliderDimY)
      return true;
   return false;
}

boolean overRNumFiltersSlider(){
  if( mouseX <= rnumFiltersSliderPos + numFiltersSliderDimX / 2 && mouseX >= rnumFiltersSliderPos - numFiltersSliderDimX / 2 &&
      mouseY >= numFiltersSliderPosY && mouseY <= numFiltersSliderPosY + numFiltersSliderDimY)
      return true;
   return false;
}

boolean betweenLRNumFiltersSliders(){
  if( mouseX < rnumFiltersSliderPos - timeSliderDimX / 2 && mouseX > lnumFiltersSliderPos + numFiltersSliderDimX / 2 &&
      mouseY >= numFiltersSliderPosY && mouseY <= numFiltersSliderPosY + numFiltersSliderDimY)
      return true;
   return false;
}

//-------------------------

void confineLSliderToBound(int w){
  if( ltimeSliderPos + timeSliderDimX / 2 + w >= rtimeSliderPos ) ltimeSliderPos = rtimeSliderPos - timeSliderDimX / 2 - w;
  if( ltimeSliderPos < timeScrollBarX1 ) ltimeSliderPos = timeScrollBarX1;
}

void confineRSliderToBound(int w){
  if( rtimeSliderPos - timeSliderDimX / 2 - w <= ltimeSliderPos ) rtimeSliderPos = ltimeSliderPos + timeSliderDimX / 2 + w;
  if( rtimeSliderPos > timeScrollBarX2 ) rtimeSliderPos = timeScrollBarX2;
}

void confineSliderToBound(int w){
  if( ltimeSliderPos > rtimeSliderPos - w ) ltimeSliderPos = rtimeSliderPos - w;
  if( ltimeSliderPos < timeScrollBarX1 ) {
    ltimeSliderPos = timeScrollBarX1;
    rtimeSliderPos = ltimeSliderPos + w;
  }
}

boolean confineLSliderToSampleBound(int w){
    int low = (int)map(ltimeSliderPos, timeScrollBarX1, timeScrollBarX2, 0, controller.numData);
    int upper = (int)map(rtimeSliderPos, timeScrollBarX1, timeScrollBarX2, 0, controller.numData); 
   
    if(low >= upper - w){
        low = upper - w; 
        ltimeSliderPos = (int)map(low, 0, controller.numData, timeScrollBarX1, timeScrollBarX2 );
        w = rtimeSliderPos - ltimeSliderPos;
        confineLSliderToBound(w);
        confineSliderToBound(w);
        return true;
    }
    return false;
}

boolean confineRSliderToSampleBound(int w){
    int low = (int)map(ltimeSliderPos, timeScrollBarX1, timeScrollBarX2, 0, controller.numData);
    int upper = (int)map(rtimeSliderPos, timeScrollBarX1, timeScrollBarX2, 0, controller.numData); 
   
    if(low >= upper - w){
        upper = low + w; 
        rtimeSliderPos = (int)map(upper, 0, controller.numData, timeScrollBarX1, timeScrollBarX2 );
        w = rtimeSliderPos - ltimeSliderPos;
        confineRSliderToBound(w);
        confineSliderToBound(w);
        return true;
    }
    
    return false;
}

void confinenumDivSliderToBound(){
  if( numDivSliderPos > numDivScrollBarX2 ) numDivSliderPos = numDivScrollBarX2;
  if( numDivSliderPos < numDivScrollBarX1 ) numDivSliderPos = numDivScrollBarX1;
}

//--------------------------------

void confineLSliderToNumFiltersBound(int w){
  if( lnumFiltersSliderPos + numFiltersSliderDimX / 2 + w >= rnumFiltersSliderPos ) lnumFiltersSliderPos = rnumFiltersSliderPos - numFiltersSliderDimX / 2 - w;
  if( lnumFiltersSliderPos < numFiltersScrollBarX1 ) lnumFiltersSliderPos = numFiltersScrollBarX1;
}

void confineRSliderToNumFiltersBound(int w){
  if( rnumFiltersSliderPos - numFiltersSliderDimX / 2 - w <= lnumFiltersSliderPos ) rnumFiltersSliderPos = lnumFiltersSliderPos + numFiltersSliderDimX / 2 + w;
  if( rnumFiltersSliderPos > numFiltersScrollBarX2 ) rnumFiltersSliderPos = numFiltersScrollBarX2;
}

void confineSliderToNumFiltersBound(int w){
  if( lnumFiltersSliderPos > rnumFiltersSliderPos - w ) lnumFiltersSliderPos = rnumFiltersSliderPos - w;
  if( lnumFiltersSliderPos < numFiltersScrollBarX1 ) {
    lnumFiltersSliderPos = numFiltersScrollBarX1;
    rnumFiltersSliderPos = lnumFiltersSliderPos + w;
  }
}


//--------------------------------

void confineLSliderToHueBound(int w){
  if( lhueSliderPos + hueSliderDimX / 2 + w >= rhueSliderPos ) lhueSliderPos = rhueSliderPos - hueSliderDimX / 2 - w;
  if( lhueSliderPos < hueScrollBarX1 ) lhueSliderPos = hueScrollBarX1;
}

void confineRSliderToHueBound(int w){
  if( rhueSliderPos - hueSliderDimX / 2 - w <= lhueSliderPos ) rhueSliderPos = lhueSliderPos + hueSliderDimX / 2 + w;
  if( rhueSliderPos > hueScrollBarX2 ) rhueSliderPos = hueScrollBarX2;
}

void confineSliderToHueBound(int w){
  if( lhueSliderPos > rhueSliderPos - w ) lhueSliderPos = rhueSliderPos - w;
  if( lhueSliderPos < hueScrollBarX1 ) {
    lhueSliderPos = hueScrollBarX1;
    rhueSliderPos = lhueSliderPos + w;
  }
}


//--------------------------------

void confineLSliderToLumaBound(int w){
  if( llumaSliderPos + lumaSliderDimX / 2 + w >= rlumaSliderPos ) llumaSliderPos = rlumaSliderPos - lumaSliderDimX / 2 - w;
  if( llumaSliderPos < lumaScrollBarX1 ) llumaSliderPos = lumaScrollBarX1;
}

void confineRSliderToLumaBound(int w){
  if( rlumaSliderPos - lumaSliderDimX / 2 - w <= llumaSliderPos ) rlumaSliderPos = llumaSliderPos + lumaSliderDimX / 2 + w;
  if( rlumaSliderPos > lumaScrollBarX2 ) rlumaSliderPos = lumaScrollBarX2;
}

void confineSliderToLumaBound(int w){
  if( llumaSliderPos > rlumaSliderPos - w ) llumaSliderPos = rlumaSliderPos - w;
  if( llumaSliderPos < lumaScrollBarX1 ) {
    llumaSliderPos = lumaScrollBarX1;
    rlumaSliderPos = llumaSliderPos + w;
  }
}

//--------------------------------

void confineLSliderToChromaBound(int w){
  if( lchromaSliderPos + chromaSliderDimX / 2 + w >= rchromaSliderPos ) lchromaSliderPos = rchromaSliderPos - chromaSliderDimX / 2 - w;
  if( lchromaSliderPos < chromaScrollBarX1 ) lchromaSliderPos = chromaScrollBarX1;
}

void confineRSliderToChromaBound(int w){
  if( rchromaSliderPos - chromaSliderDimX / 2 - w <= lchromaSliderPos ) rchromaSliderPos = lchromaSliderPos + chromaSliderDimX / 2 + w;
  if( rchromaSliderPos > chromaScrollBarX2 ) rchromaSliderPos = chromaScrollBarX2;
}

void confineSliderToChromaBound(int w){
  if( lchromaSliderPos > rchromaSliderPos - w ) lchromaSliderPos = rchromaSliderPos - w;
  if( lchromaSliderPos < chromaScrollBarX1 ) {
    lchromaSliderPos = chromaScrollBarX1;
    rchromaSliderPos = lchromaSliderPos + w;
  }
}

boolean sketchFullScreen() {
  return false;
}


void setNumFiltersSlider(){
 lnumFiltersSliderPos = numFiltersScrollBarX1; //(int)map(numFilteredColumns, 1, numFilters, numFiltersScrollBarX1, numFiltersScrollBarX2);
 rnumFiltersSliderPos = numFiltersScrollBarX2;
}
